package com.right.mapper;

import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * <pre>
 *     @author : pillar
 *     e-mail : 347637454@qq.com
 *     time   : 2019/1/3 13:04
 *     desc   :
 *     version: 1.0
 * </pre>
 */
public interface CommonMapper {

    Map<String,Object> selectRentRecord(@Param("bicycleNo") String bicycleNo, @Param("operatorId") Long operatorId);

    Map<String,Object> selectTempStop(@Param("bicycleId") Long bicycleId, @Param("rentId") Long rentId);

    int updateBicycleStatus(@Param("status") int status, @Param("updatedAt") Date updatedAt, @Param("id") Long id);

    int updateTempStopStatus(@Param("status") int status, @Param("updatedAt") Date updatedAt, @Param("id") Long id);

    Map<String,Object> selectRideAccount(@Param("accountType") int accountType ,@Param("riderId") String riderId);

    Map<String,Object> selectCharge(@Param("operatorId") Long operatorId);

    int updateBicycleDockSite( @Param("updatedAt") Date updatedAt, @Param("dockSiteNo") String dockSiteNo);

    int updateBicycleRent(@Param("endTime") Date endTime, @Param("rentTime") Integer rentTime,
                          @Param("fAmt") double fAmt,
                          @Param("updatedAt") Date updatedAt,
                          @Param("bicycleDocksiteNo") String bicycleDocksiteNo,
                          @Param("operatorId") Long operatorId,
                          @Param("bicycleDocksiteIdRent") Long bicycleDocksiteIdRent,
                          @Param("bicycleNo") String bicycleNo, @Param("riderId") String riderId);

    int updateBicycle(@Param("bicycleNo") String bicycleNo, @Param("lockNo") String lockNo,@Param("operatorId") Long operatorId);

    int insertA05Consume(@Param("RiderId") String RiderId,
                         @Param("AccountId") String AccountId,
                         @Param("RentId") String RentId,
                         @Param("Amount") BigDecimal Amount,
                         @Param("TradeAmount") BigDecimal TradeAmount,
                         @Param("InitBalance") BigDecimal InitBalance,
                         @Param("FinalBalance") BigDecimal FinalBalance,
                         @Param("TradeTime") Date TradeTime,
                         @Param("HandselScore") BigDecimal HandselScore,
                         @Param("InitScore") BigDecimal InitScore,
                         @Param("FinalScore") BigDecimal FinalScore,
                         @Param("CreateDate") Date CreateDate,
                         @Param("LastModifyDate") Date LastModifyDate,
                         @Param("operator_id") Long operator_id);

    int updateBicycleDockSiteTwo(@Param("updatedAt") Date updatedAt, @Param("dockSiteNo") String dockSiteNo);

    int updateB30Faultproblem(@Param("rentId") String rentId);

    int selectRideGrandTotalCountByRiderId(@Param("riderId")String riderId);


    int insertRideGrandTotal(@Param("riderId") String riderId,
                             @Param("timeSum") Integer timeSum,
                             @Param("chargeSum") BigDecimal chargeSum,
                             @Param("firstTime") Date firstTime,
                             @Param("lastTime") Date lastTime);

    int updateRideGrandTotal(@Param("timeSum") Integer timeSum,
                             @Param("chargeSum") BigDecimal chargeSum,
                             @Param("lastTime") Date lastTime,
                             @Param("riderId") String riderId);

    int insertBicycleEnterLend(@Param("bikeNo") String bikeNo,
                               @Param("riderId") String riderId,
                               @Param("lendDocksiteNo") String lendDocksiteNo,
                               @Param("returnDocksiteNo") String returnDocksiteNo,
                               @Param("createdAt") Date createdAt,
                               @Param("rentId") String rentId);

    int updateA02AccountYuE( @Param("fAmt") BigDecimal fAmt,
                             @Param("LastModifyDate") Date LastModifyDate,
                             @Param("riderId") String riderId);

    int updateA02AccountJiFen(@Param("fAmt") BigDecimal fAmt,
                              @Param("LastModifyDate") Date LastModifyDate,
                              @Param("riderId") String riderId);

    int selectPdaUseronlineCountByRiderId(@Param("riderId") String riderId);

    Map<String,Object> selectPdaUseronlineByRiderId(@Param("riderId")String riderId);

    int updateBicycleDispatchSheetMessage(@Param("bicycleDocksiteIdRent") String bicycleDocksiteIdRent,@Param("bicycleId") Long bicycleId);

    int updateBicycleTwo(@Param("bicycleNo") String bicycleNo, @Param("lockNo") String lockNo,@Param("operatorId") Long operatorId);

    int selectM06unlockingCount(@Param("bikeNo") String bikeNo);

    int updateM06unlocking(@Param("chargePileNoReturn") String chargePileNoReturn, @Param("bikeNo") String bikeNo);
}
